layui.use(['table', 'admin', 'ax','laydate','form'], function () {
    var $ = layui.$;
    var table = layui.table;
    var $ax = layui.ax;
    var admin = layui.admin;
    var laydate = layui.laydate;
    var form = layui.form;

    /**
     * 齐河小车任务情况
     */
    var BiTuskRoadWayList = {
        tableId: "biTuskRoadWayListTable"
    };

    /**
     * 齐河AGV任务情况
     */
    BiTuskRoadWayList.initColumn = function () {
        return [[
            {field: 'C1', sort: true, title: 'C1', style:'font-weight: 600;', templet: '#getRoadInfoC1'},
            {field: 'C2', sort: true, title: 'C2', style:'font-weight: 600;', templet: '#getRoadInfoC2'},
            {field: 'C3', sort: true, title: 'C3', style:'font-weight: 600;', templet: '#getRoadInfoC3'},
            {field: 'C4', sort: true, title: 'C4', style:'font-weight: 600;', templet: '#getRoadInfoC4'},
            {field: 'C5', sort: true, title: 'C5', style:'font-weight: 600;', templet: '#getRoadInfoC5'},
            {field: 'C6', sort: true, title: 'C6', style:'font-weight: 600;', templet: '#getRoadInfoC6'},
            {field: 'C7', sort: true, title: 'C7', style:'font-weight: 600;', templet: '#getRoadInfoC7'},
        ]];
    };

    /**
     * 点击查询按钮
     */
    BiTuskRoadWayList.search = function () {
        var queryData = {};
        queryData['plateNumber'] = $("#plateNumber").val();
        table.reload(BiTuskRoadWayList.tableId, {
            where: queryData, page: {curr: 1},
             done:function () {
                 $("th").hide();
            }
        });
    };

    // 渲染表格
    var tableResult = table.render({
        elem: '#' + BiTuskRoadWayList.tableId,
        url: Feng.ctxPath + '/biTuskRoadWayList/listAll',
        page: false,
        limit: 20,
        height: "full-60",
        // toolbar: '#toolbarfrom',
        cellMinWidth: 100,
        cols: BiTuskRoadWayList.initColumn(),
        done:function (res,curr,count) {
            $("th").hide();
            
        }
    });

    // 搜索按钮点击事件
    $('#btnSearch').click(function () {
        BiTuskRoadWayList.search();
    });

});
